package indi.MegaAstronic.cppUtils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;

public class TxtToCout {
	
	public static void fileToCout(PrintStream output, String filePath) throws FileNotFoundException {
		File file = new File(filePath);
		
		System.out.println(file.getAbsolutePath());
		Scanner input = new Scanner(file);
		String tem;
		while(input.hasNext()){
			tem=input.nextLine();
			System.out.println(toCout(tem));//
			output.append(toCout(tem));
			output.append("\r\n");
		}
		
		input.close();

	}

	public static String toCout(String str) {
		return "cout<< \"" + str + "\" << endl;";
	}
	
	public static boolean matchPaint(String str){
		str=str.trim();
		return str.matches("paint\\([^;]{1,}\\);");
	}
	
	public static String getPaintPath(String str){
		str=str.trim();
		return str.substring(7, str.length()-3);
	}

}
